The present invention relates to an asynchronous sampling frequency conversion device, a method, and a computer program product.
When an analog signal is converted into a digital signal, a sampling method of reading the waveform level of the analog signal at given time intervals and recording the read level value is used. In digital audio devices or the like, 32 kHz, 44.1 kHz, 48 kHz, and 96 kHz are generally used as sampling frequencies. For example, in cases of a CD (compact disc) and a DVD (digital versatile disc), sampling is performed at 44.1 kHz and 48 kHz, respectively.
For example, when a digital signal is transmitted and received between devices in which sampling frequencies are different, it is necessary to convert the sampling frequency of the digital signal. In order to change the sampling frequency of a digital signal, an asynchronous sampling rate converter is used.
A conventional asynchronous sampling rate converter changes a sampling frequency by performing up-sampling (0 compensation) on an input signal up to the least common multiple between sample frequencies before and after conversion, and then performing down-sampling (thinning) to a desired sampling frequency. Accordingly, for example, when the conventional asynchronous sampling rate converter converts a sampling frequency from 48 kHz to 44.1 kHz, the conventional asynchronous sampling rate converter has to perform up-sampling up to 7056 kHz which is the least common multiple between 48 kHz and 44.1 kHz, that is, up-sampling by 147 multiples of the input signal.
In the conventional asynchronous sampling rate converter, a LPF (Lowpass Filter) that cuts a high-frequency component equal to or greater than the nyquist frequency (½ of the sampling frequency of an input signal) is disposed between an up-sampling unit and a down-sampling unit. An input signal into the LPF is a signal subjected to the up-sampling, and the sampling frequency of the signal is very high, as described above. For this reason, the LPF is required to have high-speed responsiveness and a high processing performance.
As a technology for suppressing a processing amount in an asynchronous sampling converter, a method of using linear interpolation is suggested by Japanese Laid-open Patent Publication No. 1-77326.
According to the method of using linear interpolation disclosed in Japanese Laid-open Patent Publication No. 1-77326, sample data Yi (where i is a natural number) after conversion is calculated from two pieces of sampling data Xn and Xn+1 (where n is a natural number) before conversion sampled at timings immediately before and after the sampling timing of Yi. Specifically, Yi is calculated by a calculation expression “Yi=(1−ki)·Xn+ki·Xn+1” using ki as an interpolation coefficient corresponding to Yi.
The interpolation coefficient ki is calculated by “ki=(i·θ2−n·θ1)/θ1” by first specifying n that satisfies “n·θ1≦i·θ2<(n+1)·θ1” for each i, when it is assumed that θ1 is an input sampling period and θ2 is an output sampling period. Thus, in the method of using the linear interpolation disclosed in Japanese Laid-open Patent Publication No. 1-77326, it is necessary to first specify “n” and calculate each interpolation coefficient ki using the specified “n” in order to calculate each sampling data Yi after conversion. For this reason, it takes much time to perform the calculation, since a calculation amount is large.
According to the sampling theorem, an input signal with a frequency band up to ½ of an input clock frequency fin(=1/θ1) can be reproduced. However, due to the frequency characteristics of the linear interpolation, the amplitude of a waveform reproduced from the output sampling data Yi calculated through the linear interpolation decreases, as the frequency band of an input signal increases. Therefore, waveform distortion may be worsened. For example, with regard to an input signal with a frequency band of ½ of an input clock frequency fin, the amplitude of a waveform formed by the output sampling data Yi may decrease about 0.64 times the amplitude of the input signal.